using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CodePlex.SpaceBlock;

namespace CodePlex.SpaceBlock.UI.Controls
{
    public partial class SelectFolderForm : CodePlex.SpaceBlock.UI.Controls.BaseForm
    {

        private Path _path;

        public SelectFolderForm()
        {
            InitializeComponent();

            UIUtils.FillWith(_panelHolder, new FoldersControl());

            this.FoldersControl.FolderChanged += delegate
            {
                _path = this.FoldersControl.SelectedFolder;
            };

            this.Load += delegate
            {
                this.FoldersControl.SelectedFolder = Path.Root;
            };
        }

        public void Initialize(IFileSystem fileSystem)
        {
            this.FoldersControl.Initialize(fileSystem);
        }

        public Path SelectedFolder
        {
            get
            {
                return _path;
            }
        }






        private FoldersControl FoldersControl
        {
            get
            {
                return _panelHolder.Controls[0] as FoldersControl;
            }
        }


    }
}

